var nodemailer = require("nodemailer");

var transporter = nodemailer.createTransport({
    service: "outlook",
    auth: {
        user: "hughoo@outlook.com",
        pass: "pply419zz!"
    }
});

var message = {
    from: "Hugo Hoo<hughoo@outlook.com>",
    to: "hughoo@outlook.com",
    subject: "Attachments",
    text: "This is text",
    html: "<h1>Hello Attachments.</h1>",
    attachments: [
        {
            filename: "Test01.txt",
            content: "Hello Test01"
        },
        {
            filename: "Test02.txt",
            path: "Test02.txt"
        }
    ]
};

transporter.sendMail(message, function(err, info){
    if(err){
        console.log("Email sent [failed] : " + err.stack);
    }else{
        console.log("Email sent [success] : " + info.response);
    }
});